import request from '@/utils/request'

export function getNode() {
  return request({
    url: '/node',
    method: 'get'
  })
}

export function createNode(params) {
  return request({
    url: '/node',
    method: 'post',
    data: JSON.stringify(params)
  })
}

export function getNodeInfo(id) {
  return request({
    url: '/node/' + id,
    method: 'get'
  })
}

export function getCategory() {
  return request({
    url: '/node/category',
    method: 'get'
  })
}

export function createCategory(params) {
  return request({
    url: '/node/category',
    method: 'post',
    params: params
  })
}

export function getQiNiuToken() {
  return request({
    url: '/node/token',
    method: 'get'
  })
}
